import { useApi } from "@ret-utils/axios-request";
import { http } from "./base/http";
import { getLoginInfoByH5 } from "@/utils";

// 未登录查询预约信息
export const fetchNotLogEtfActivity = useApi(async (params: any) => {
  return await http.get("/ret-activity-server/etfCombi/getButton", { params });
});

// 已登录查询预约信息
export const fetchLogInEtfActivity = useApi(async (params: any) => {
  const { servticketId } = getLoginInfoByH5();
  console.log(servticketId, "已登录查询预约信息");
  return await http.get("/ret-activity-server/etfCombi/getButtonByToken", { params, servticketId });
});

// 储存预约数据
export const fetchLogInEtSubscribe = useApi(async (params: any) => {
  const { servticketId } = getLoginInfoByH5();
  console.log(servticketId, "储存预约数据");
  return await http.post("/ret-activity-server/etfCombi/reserve", { params, servticketId });
});
